<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="js/vue.js">
    </script>
</head>
<body>
    <div id="root">
        <p>徐以民当前的值为：{{n}}</p>
        <button v-on:click="add">n+1</button>    
        <button v-on:click="show">surprise</button> 
        <div v-on:click="showMeg(1)"> 
            <a @click.prevent="atEdu" href="http://www.usth.edu.cn" target="_blank" >科技大</a>
        </div>
    </div>
    
    <script>
        const vm = new Vue({
            el:'#root',
            data:{
                n:12
            },
            methods : {
                add(){
                    vm.n+=2;
                },
                show(){
                    console.log("按钮点击");
                    alert("徐以民aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccdddddddddddddddddddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeee")
                },
                showMeg(num){
                    console.log("div"+num+"被点击");
                    
                },
                atEdu(){
                    console.log(
                        alert("阻止"),
                        console.log("被阻止")
                    );
                    
                }
            }
        });
        vm.$mount('#root');
        
    </script>
    
</body>
</html>